// 地图层

#ifndef ALICE_MAP_GAME_MAP_H_
#define ALICE_MAP_GAME_MAP_H_

#include <vector>

#include "layer.h"

namespace alice {

class GameMap {
  public:
    void Render() {
      for (unsigned int i = 0; i < map_layers_.size(); i++) {
        map_layers_[i]->Render();
      }
    }

    void Update() {
      for (unsigned int i = 0; i < map_layers_.size(); i++) {
        map_layers_[i]->Update();
      }
    }

    void Clear() {
      for (unsigned i = 0; i < map_layers_.size(); i++) {
        delete map_layers_[i];
      }
      map_layers_.clear();
    }

    void AddLayer(Layer* layer) { map_layers_.push_back(layer); }

    std::vector<Layer*> GetMapLayers() { return map_layers_; }

  private:
    std::vector<Layer*> map_layers_;
};

}

#endif // ALICE_MAP_GAME_MAP_H_